import request from "@/utils/request.ts";


export function uploadFileUrl(url, files) {
    return request({
        url: url,
        method: 'post',
        headers: {
            'Content-Type': 'multipart/form-data'
        },
        data: files
    })
}

function getPath(projectId, issueId, columnsId) {
    return `/file/uploadProject/${projectId}/${issueId}/${columnsId}`
}


/*
* 上传文件封面
* */
export function getUploadFileCoverUrl(columnsId) {
    return getPath(3, 0, columnsId)
}

/*
* 上传文章图片
* */
export function getUploadFileArticleUrl(columnsId) {
    return getPath(3, 1, columnsId)
}


/*
* 删除文件
* */
export function deleteFileUrl(id) {
    return request({
        url: '/file/deleteFile',
        method: 'delete',
        params: {
            id: id
        }
    })
}
